package helper.base

import helper.base.debug.DebugHelper.LevelDebugger.Companion.debugger_0
import helper.base.debug.DebugHelper.DebuggerList
import helper.base.debug.DebugHelper.DebuggerList.Companion.makeDebuggerList
import java.net.URL

object ResourceHelper {
    @Suppress("NULLABILITY_MISMATCH_BASED_ON_JAVA_ANNOTATIONS")
    fun getResource(
        string: String,
        debuggerList: DebuggerList = makeDebuggerList(
            debugger_0,
        ),
    ): URL {
        debuggerList.pln(
            "getResource():${string}",
            debugger_0,
        )
        val resource = ResourceHelper::class.java.classLoader.getResource(
            string,
        )
        debuggerList.pln(
            "res:${resource}",
            debugger_0,
        )
        return resource
    }

    val resDirPrefix = "src/main/resources"
    val resDirPrefix_t = "target/classes"
}